package com.jml.datasource2.dao;

import com.jml.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Param;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;

@CacheConfig(cacheNames = "baseCache")
public interface UserMapperTest02 {

	@Insert("insert into users values(null,#{name},#{age});")
	public int insert(@Param("name") String name, @Param("age") Integer age);

	@Cacheable
	@Select("select * from users where name=#{name}")
	User findByName(@Param("name") String name);
}
